package cn.xchats.rpc.common.util;


import cn.xchats.rpc.common.dto.ResponseDto;

/*
 *
 *@author teddy
 *@date 2018/7/2
 */
public class ResponseUtil {

    /**
     * 失败
     */
    public static ResponseDto fail(long requestId, String code, String message){
        ResponseDto response = new ResponseDto();
        response.setId(requestId);
        response.setCode(code);
        response.setMessage(message);
        return response;
    }

    public static ResponseDto success(long requestId,Object result){
        ResponseDto response = new ResponseDto();
        response.setId(requestId);
        response.setBody(result);
        return response;
    }
}
